﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace IISLogAnalyzer
{
    public partial class FormSetColumns : Form
    {
        public FormSetColumns()
        {
            InitializeComponent();

            cbxDate.Checked = Statics._date == 1;
            cbxTime.Checked = Statics._time == 1;
            cbxSsitename.Checked = Statics._ssitename == 1;
            cbxScomputername.Checked = Statics._scomputername == 1;
            cbxSip.Checked = Statics._sip == 1;
            cbxCsmethod.Checked = Statics._csmethod == 1;
            cbxCsuristem.Checked = Statics._csuristem == 1;
            cbxCsuriquery.Checked = Statics._csuriquery == 1;
            cbxSport.Checked = Statics._sport == 1;
            cbxCsusername.Checked = Statics._csusername == 1;
            cbxCip.Checked = Statics._cip == 1;
            cbxCsversion.Checked = Statics._csversion == 1;
            cbxCsuseragent.Checked = Statics._csuseragent == 1;
            cbxCscookie.Checked = Statics._cscookie == 1;
            cbxCsreferer.Checked = Statics._csreferer == 1;
            cbxCshost.Checked = Statics._cshost == 1;
            cbxScstatus.Checked = Statics._scstatus == 1;
            cbxScsubstatus.Checked = Statics._scsubstatus == 1;
            cbxScwin32status.Checked = Statics._scwin32status == 1;
            cbxScbytes.Checked = Statics._scbytes == 1;
            cbxCsbytes.Checked = Statics._csbytes == 1;
            cbxTimetaken.Checked = Statics._timetaken == 1;
            cbxAddtime.Checked = Statics._add_time == 1;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Statics._date = cbxDate.Checked ? 1 : 0;
            Statics._time = cbxTime.Checked ? 1 : 0;
            Statics._ssitename = cbxSsitename.Checked ? 1 : 0;
            Statics._scomputername = cbxScomputername.Checked ? 1 : 0;
            Statics._sip = cbxSip.Checked ? 1 : 0;
            Statics._csmethod = cbxCsmethod.Checked ? 1 : 0;
            Statics._csuristem = cbxCsuristem.Checked ? 1 : 0;
            Statics._csuriquery = cbxCsuriquery.Checked ? 1 : 0;
            Statics._sport = cbxSport.Checked ? 1 : 0;
            Statics._csusername = cbxCsusername.Checked ? 1 : 0;
            Statics._cip = cbxCip.Checked ? 1 : 0;
            Statics._csversion = cbxCsversion.Checked ? 1 : 0;
            Statics._csuseragent = cbxCsuseragent.Checked ? 1 : 0;
            Statics._cscookie = cbxCscookie.Checked ? 1 : 0;
            Statics._csreferer = cbxCsreferer.Checked ? 1 : 0;
            Statics._cshost = cbxCshost.Checked ? 1 : 0;
            Statics._scstatus = cbxScstatus.Checked ? 1 : 0;
            Statics._scsubstatus = cbxScsubstatus.Checked ? 1 : 0;
            Statics._scwin32status = cbxScwin32status.Checked ? 1 : 0;
            Statics._scbytes = cbxScbytes.Checked ? 1 : 0;
            Statics._csbytes = cbxCsbytes.Checked ? 1 : 0;
            Statics._timetaken = cbxTimetaken.Checked ? 1 : 0;
            Statics._add_time = cbxAddtime.Checked ? 1 : 0;

            this.Close();
        }

        private void btnDefalut_Click(object sender, EventArgs e)
        {
            Statics._date = 1;
            cbxDate.Checked = true;

            Statics._time = 1;
            cbxTime.Checked = true;

            Statics._ssitename = 1;
            cbxSsitename.Checked = true;

            Statics._scomputername = 0;
            cbxScomputername.Checked = false;

            Statics._sip = 0;
            cbxSip.Checked = false;

            Statics._csmethod = 1;
            cbxCsmethod.Checked = true;

            Statics._csuristem = 1;
            cbxCsuristem.Checked = true;

            Statics._csuriquery = 1;
            cbxCsuriquery.Checked = true;

            Statics._sport = 0;
            cbxSport.Checked = false;

            Statics._csusername = 0;
            cbxCsusername.Checked = false;

            Statics._cip = 1;
            cbxCip.Checked = true;

            Statics._csversion = 0;
            cbxCsversion.Checked = false;

            Statics._csuseragent = 0;
            cbxCsuseragent.Checked = false;

            Statics._cscookie = 0;
            cbxCscookie.Checked = false;

            Statics._csreferer = 0;
            cbxCsreferer.Checked = false;

            Statics._cshost = 0;
            cbxCshost.Checked = false;

            Statics._scstatus = 0;
            cbxScstatus.Checked = false;

            Statics._scsubstatus = 0;
            cbxScsubstatus.Checked = false;

            Statics._scwin32status = 0;
            cbxScwin32status.Checked = false;

            Statics._scbytes = 1;
            cbxScbytes.Checked = true;

            Statics._csbytes = 1;
            cbxCsbytes.Checked = true;

            Statics._timetaken = 1;
            cbxTimetaken.Checked = true;

            Statics._add_time = 1;
            cbxAddtime.Checked = true;
        }
    }
}
